import request from '@/config/axios'

export interface MerchantListVO {
  id:number
  name: string
  merchantType: number
  merchantTypeName: string
  address: string
  merchantIntro: string
  merchantCover: string
}

// 查询相亲商家信息列表
export const getMerchantListPage = async (params) => {
  return await request.get({ url: `/activity/merchant-info/page`, params })
}

// 查询相亲商家类型列表
export const getMerchantListAll = async () => {
  return await request.get({ url: `/activity/merchant-info/getMerchantInfoList` })
}

// 查询相亲商家类型列表
export const getMerchantTypeList = async () => {
  return await request.get({ url: `/activity/merchant-info/getMerchantTypeList` })
}

// 查询相亲商家信息详情
export const getMerchantList = async (id: number) => {
  return await request.get({ url: `/activity/merchant-info/get?id=` + id })
}

// 新增相亲商家信息
export const createMerchantList = async (data: MerchantListVO) => {
  return await request.post({ url: `/activity/merchant-info/create`, data })
}

// 修改相亲商家信息
export const updateMerchantList = async (data: MerchantListVO) => {
  return await request.put({ url: `/activity/merchant-info/update`, data })
}

// 删除相亲商家信息
export const deleteMerchantList = async (id: number) => {
  return await request.delete({ url: `/activity/merchant-info/delete?id=` + id })
}

// 导出相亲商家信息 Excel
export const exportMerchantList = async (params) => {
  return await request.download({ url: `/activity/merchant-info/export-excel`, params })
}
